﻿<Window x:Class="Resn.WhuPub.WPFClientUI.CreateVisitWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ext="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
        Style="{StaticResource WindowStyle}" WindowStartupLocation="CenterScreen"
        Loaded="Window_Loaded" MouseDown="Window_OnMouseDown">
        <Grid Name="LayoutRoot">
                <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid Background="{StaticResource TitleGridColor}">
                        <TextBlock Text="新建拜访事件" Style="{DynamicResource BigTextBlockStyle}" />
                </Grid>

                <Grid Grid.Row="1" Background="{StaticResource ContentGridColor}">
                        <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>

                        <TextBlock Grid.Column="0" Grid.Row="0" Text="联系人" HorizontalAlignment="Right" />
                        <ComboBox Grid.Column="1" Grid.Row="0"
                                  ItemsSource="{Binding LoginEmployee.Contacts}"
                                  DisplayMemberPath="Name"
                                  SelectedValue="{Binding Contact}" Name="VisitNameTextBox"
                                  HorizontalAlignment="Stretch"  />

                        <TextBlock Grid.Column="0" Grid.Row="1" HorizontalAlignment="Right" Text="拜访方式"
                                    VerticalAlignment="Center" />
                        <ComboBox Grid.Column="1" Grid.Row="1" Name="VisitTypeComboBox"
                                  SelectedValue="{Binding VisitVisitType}" />

                        <TextBlock Grid.Column="0" Grid.Row="2" HorizontalAlignment="Right"
                                    Text="拜访目的" VerticalAlignment="Top" />
                        <TextBox Grid.Column="1" Grid.Row="2" 
                                 Text="{Binding VisitObjective}" MinHeight="60" AcceptsReturn="True" AcceptsTab="True"
                                 TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" MinWidth="480" />

                        <TextBlock Grid.Column="0" Grid.Row="3" Text="重点事件" HorizontalAlignment="Right" VerticalAlignment="Top" />
                        <TextBox Grid.Column="1" Grid.Row="3" 
                                 Text="{Binding VisitKeyEvents}" MinHeight="140" AcceptsReturn="True" AcceptsTab="True"
                                 TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" />

                        <TextBlock Grid.Column="0" Grid.Row="4" HorizontalAlignment="Right"
                                   Text="宴请消费金额"
                                   VerticalAlignment="Center"  />
                        <ext:DoubleUpDown Grid.Column="1" Grid.Row="4" Style="{StaticResource DoubleUpDownStyle}"
                                          Value="{Binding StringFormat=\{0:c\}, Path=VisitEatAmount}" />

                        <TextBlock Grid.Column="0" Grid.Row="5" HorizontalAlignment="Right" Text="礼品消费金额" VerticalAlignment="Center"  />
                        <ext:DoubleUpDown Grid.Column="1" Grid.Row="5" HorizontalAlignment="Stretch"
                                          Value="{Binding StringFormat=\{0:c\}, Path=VisitGiftAmount}"
                                          Style="{StaticResource DoubleUpDownStyle}" Margin="6" />

                        <TextBlock Grid.Column="0" Grid.Row="6" HorizontalAlignment="Right" Text="开始时间"
                                   VerticalAlignment="Center"  />
                        <DatePicker Grid.Column="1" Grid.Row="6"
                                    SelectedDate="{Binding StartTime}" HorizontalAlignment="Left"
                                    VerticalAlignment="Center" Margin="8" MinWidth="200" SelectedDateFormat="Long" Height="30" />

                        <TextBlock Grid.Column="0" Grid.Row="7" HorizontalAlignment="Right" Text="结束时间"
                                   VerticalAlignment="Center"  />
                        <DatePicker Grid.Column="1" Grid.Row="7"
                                    SelectedDate="{Binding EndTime}" Margin="6"
                                    HorizontalAlignment="Left" MinWidth="200" SelectedDateFormat="Long" Height="30" />

                        <TextBlock Grid.Column="0" Grid.Row="8" HorizontalAlignment="Right"
                                    Text="备注" VerticalAlignment="Top" />
                        <TextBox Grid.Column="1" Grid.Row="8" 
                                 Text="{Binding Memo}" MinHeight="60" AcceptsReturn="True" AcceptsTab="True"
                                 TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" MinWidth="480" />

                </Grid>
                <Grid Grid.Row="2" Background="{StaticResource ContentGridColor}">
                        <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="1" Style="{DynamicResource WindowCancelButtonStyle}"/>
                        <Button Grid.Column="2" Style="{DynamicResource WindowAcceptButtonStyle}" Click="AcceptButton_Click" />
                </Grid>
        </Grid>
</Window>